package com.itheima.demo;

import java.time.Duration;
import java.time.LocalDateTime;

public class JDK8DateDemo10 {
    public static void main(String[] args) {
        LocalDateTime localDateTime2 = LocalDateTime.of(2020, 12, 13, 14, 15, 35);
        LocalDateTime localDateTime1 = LocalDateTime.of(2020, 12, 12, 13, 14, 15);

        Duration duration =Duration.between(localDateTime1,localDateTime2);

        System.out.println(duration);
        System.out.println(duration.toHours());
        System.out.println(duration.toMinutes());
        System.out.println(duration.toSeconds());
        System.out.println(duration.toNanos());
    }
}
